﻿using MediatR;
using RBAC.LuFang.API.Application.Command.RoleMenuCommand;
using RBAC.LuFang.Domin.Services;
using static RBAC.LuFang.Domin.Services.RoleMenuService;

namespace RBAC.LuFang.API.Application.CommandHandlers.RoleMenuHandler
{
    public class RoleMenuSelectCommandHandler:IRequestHandler<RoleMenuSelectCommand, List<Menutun1>>
    {
        private readonly IRoleMenuService _roleMenuService;

        public RoleMenuSelectCommandHandler(IRoleMenuService roleMenuService)
        {
            _roleMenuService = roleMenuService;
        }

        public async Task<List<Menutun1>> Handle(RoleMenuSelectCommand request, CancellationToken cancellationToken)
        {
            return await _roleMenuService.GetMenu();
        }
    }
}
